package com.hxzy.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hxzy.controller.front.mapstruct.MerchandiserConvert;
import com.hxzy.controller.front.merchandiser.resp.EnterpriseProcessResp;
import com.hxzy.entity.EnterpriseProcess;
import com.hxzy.service.EnterpriseProcessService;
import com.hxzy.mapper.EnterpriseProcessMapper;
import org.springframework.stereotype.Service;

import java.util.List;

/**
* @author 11452
* @description 针对表【enterprise_process(商家审核意见表)】的数据库操作Service实现
* @createDate 2023-07-11 14:21:59
*/
@Service
public class EnterpriseProcessServiceImpl extends ServiceImpl<EnterpriseProcessMapper, EnterpriseProcess>
    implements EnterpriseProcessService{

    @Override
    public List<EnterpriseProcessResp> findHistoryByTenantId(Long tenantId) {
        LambdaQueryWrapper<EnterpriseProcess> queryWrapper=new LambdaQueryWrapper<>();
        queryWrapper.eq(EnterpriseProcess::getTenantId, tenantId);
        queryWrapper.orderByDesc(EnterpriseProcess::getCreateTime);

        List<EnterpriseProcess> list = super.list(queryWrapper);
        return MerchandiserConvert.INSTANCE.convert(list);
    }
}




